#ifndef _KEY_H
	#define _KEY_H
	
#include "stm32f10x.h"

#define RB1 GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_0)
#define RB2 GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_8)
#define RB3 GPIO_ReadInputDataBit(GPIOB,GPIO_Pin_1)
#define RB4 GPIO_ReadInputDataBit(GPIOB,GPIO_Pin_2)

#define storage_switch 1
#define time_set_switch 2
#define time_add_low 3
#define timing_ctrl 4

#define seting_store 5
#define exti_timing 7

#define hour_set 21
#define min_set 22
#define sec_set 23

#define timing_running 41
#define timing_pause 40
#define timing_standby 42


extern u32 TimingDelay;
extern u8 set_num;
extern u32 time[5];
extern u8 lcd_state;

void delay_ms(u32 nTime);
u8 key_scan(void);
void key_init(void);
void write_data(u8 addr,u8 data);
u8 read_data(u8 addr);
void get_state(void);
#endif